<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.browsesoft.servertext.*" %>
<%@ page import="com.browsesoft.*" %>
<%@ page import="com.browsesoft.dbtools.*" %>
<%@ page import="com.browsesoft.website.*" %>
<%

 MIMEParser mimep = new MIMEParser(request);
  //byte[] context = mimep.getFileContent(attackmentName);

 // Attackment a = new Attackment(attackmentName, id, context);
 // a.save();

//byte[]  b  = mimep.getLine() ;
try
{
String id = request.getParameter("parentid").toString();
Hashtable ht=mimep.getFileAndAddress();
String name=(String)ht.keys().nextElement();
String tempStr = name.substring(name.indexOf("_")+1,name.lastIndexOf("."));
tempStr = name.replaceAll(tempStr,"");

String address=(String)ht.get(name);
address = address.replaceAll(name,tempStr);
name = tempStr;

Attackment a=new Attackment(name,id,address);
AttackmentGroup attg=(AttackmentGroup)ManagerGroup.getManagerGroup().getManager("attackment");
attg.add(a);
a.save();

    String[][] temp = DBTools.executeQueryWithTableHead(
        "select attackmentname from t_attack where processid= '" +
        id + "'");
    Hashtable htw = DBTools.getAttributes(temp, 1);
  String  fileName = (String) htw.get("attackmentname");
}
catch(Exception ee)
{
ee.printStackTrace();
}
%>
<html>
<head>
</head>
<body onload="window.close()">
</body>
</html>
